package com.dianping.cat.home.alert.summary.entity;

import com.dianping.cat.home.alert.summary.BaseEntity;
import com.dianping.cat.home.alert.summary.IVisitor;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

public class AlertSummary
  extends BaseEntity<AlertSummary>
{
  private Date m_alertDate;
  private String m_domain;
/*  14 */   private Map<String, Category> m_categories = new LinkedHashMap();






/*  21 */   public void accept(IVisitor visitor) { visitor.visitAlertSummary(this); }


  public AlertSummary addCategory(Category category) {
    this.m_categories.put(category.getName(), category);
/*  26 */     return this;
  }


  public boolean equals(Object obj) {
    if (obj instanceof AlertSummary) {
      AlertSummary _o = (AlertSummary)obj;

/*  34 */       if (!equals(getAlertDate(), _o.getAlertDate())) {
/*  35 */         return false;
      }

/*  38 */       if (!equals(getDomain(), _o.getDomain())) {
/*  39 */         return false;
      }

/*  42 */       if (!equals(getCategories(), _o.getCategories())) {
/*  43 */         return false;
      }


/*  47 */       return true;
    }

/*  50 */     return false;
  }


/*  54 */   public Category findCategory(String name) { return (Category)this.m_categories.get(name); }


  public Category findOrCreateCategory(String name) {
/*  58 */     Category category = (Category)this.m_categories.get(name);

/*  60 */     if (category == null) {
/*  61 */       synchronized (this.m_categories) {
/*  62 */         category = (Category)this.m_categories.get(name);

/*  64 */         if (category == null) {
/*  65 */           category = new Category(name);
/*  66 */           this.m_categories.put(name, category);
        }
      }
    }

/*  71 */     return category;
  }


/*  75 */   public Date getAlertDate() { return this.m_alertDate; }



/*  79 */   public Map<String, Category> getCategories() { return this.m_categories; }



/*  83 */   public String getDomain() { return this.m_domain; }



  public int hashCode() {
/*  88 */     int hash = 0;

/*  90 */     hash = hash * 31 + ((this.m_alertDate == null) ? 0 : this.m_alertDate.hashCode());
/*  91 */     hash = hash * 31 + ((this.m_domain == null) ? 0 : this.m_domain.hashCode());
/*  92 */     return hash * 31 + ((this.m_categories == null) ? 0 : this.m_categories.hashCode());
  }




  public void mergeAttributes(AlertSummary other) {
/*  99 */     if (other.getAlertDate() != null) {
/* 100 */       this.m_alertDate = other.getAlertDate();
    }

/* 103 */     if (other.getDomain() != null) {
/* 104 */       this.m_domain = other.getDomain();
    }
  }


/* 109 */   public Category removeCategory(String name) { return (Category)this.m_categories.remove(name); }


  public AlertSummary setAlertDate(Date alertDate) {
/* 113 */     this.m_alertDate = alertDate;
/* 114 */     return this;
  }

  public AlertSummary setDomain(String domain) {
/* 118 */     this.m_domain = domain;
/* 119 */     return this;
  }
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/alert/summary/entity/AlertSummary.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */